{% extends 'finance_base.html' %}
{% block title %}Transaction detail{% endblock %}
{% block stylesheet %}
{{ block.super }}
{% endblock%}

{% block javascript %}
{{ block.super }}
<script type="text/javascript">
//<![CDATA[
$(document).ready(function() {
    $('.delete').click(function() {
        var b = confirm("Do you really want to delete it?");
        if (b == false) {
            return false;
        }
    });
});
//]]>
</script>
{% endblock%}


{% block content %}
<h3>Transaction detail</h3>
<div id="navi">
    <ul>
        <li><a href="{% url transaction_change transaction.id  %}">change</a></li>
        <li class="delete"><a href="{% url transaction_detail transaction.id  %}">delete</a></li>
        <li><a href="{% url transaction_detail transaction.id  %}">email</a></li>
    </ul>
</div>

{% load humanize %}
<table class="detail">
    <tr>
        <th>날짜</th>
        <th>항목</th>
        <th>출금/입금</th>
        <th>금액</th>
        <th>통장구분</th>
        <th>구분</th>
    </tr>
    <tr>
        <td>
            {{ transaction.date }}
        </td>
        <td>
            {{ transaction.category }}
        </td>
        <td>
            {{ transaction.type }}
        </td>
        <td>
            {{ transaction.amount }}
        </td>
        <td>
            {{ transaction.account }}
        </td>
        <td>
            {{ transaction.location }}
        </td>
    </tr>
    <tr>
        <th colspan=6>내용</th>
    </tr>
    <tr>
        <td colspan=6>
            {{ transaction.detail|safe }}
        </td>
    </tr>
    <tr>
        <th colspan=6>비고</th>
    </tr>
    <tr>
        <td colspan=6>
            {{ transaction.note|safe }}
        </td>
    </tr>
</table>


{% endblock %}